home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / circuits / spice2g6.z / spice2g6 / spice / Fortran / memptr.f < prev    next >
Encoding:
Text File  |  1989-02-03  |  834 b   |  26 lines

  1.       logical function memptr(ipntr)
  2.       implicit double precision (a-h,o-z)
  3. c
  4. c      this routine checks whether *ipntr* is a valid block pointer.
  5. c if it is valid, *ltab* is set to point to the corresponding entry in
  6. c the block table.
  7. c
  8. c... ipntr is an array to avoid 'call by value' problems (see setmem)
  9.       dimension ipntr(1)
  10. c spice version 2g.6  sccsid=memmgr 3/15/83
  11.       common /memmgr/ cpyknt,istack(1),lorg,icore,maxcor,maxuse,memavl,
  12.      1   ldval,numblk,loctab,ltab,ifwa,nwoff,ntab,maxmem,memerr,nwd4,
  13.      2   nwd8,nwd16
  14.       memptr=.false.
  15.       ltab=loctab
  16.       locpnt=locf(ipntr(1))
  17.       do 20 i=1,numblk
  18.       if (locpnt.ne.istack(ltab+4)) go to 10
  19.       if (ipntr(1)*istack(ltab+5).ne.istack(ltab+1)) go to 10
  20.       memptr=.true.
  21.       go to 30
  22.    10 ltab=ltab+ntab
  23.    20 continue
  24.    30 return
  25.       end
  26.